<html>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<body>

  <input style="height: 100px;width: 100%;" type="text" id="zz" value="/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-HJ-NP-Z]{1}(?:(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))|[A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]{1})$/" style="width: 100%">
  车牌号
  <input type="text" oninput="jy()" id="val" value="">
  <button onclick="jy()">点击校验</button>
  <div id="show">

  </div>

</body>

<script>
  function jy(){
    let zz =  eval(document.querySelector("#zz").value)
    if(zz.test(document.querySelector("#val").value)){
      document.querySelector("#show").innerHTML = "通过"
    } else {
      document.querySelector("#show").innerHTML = "不通过"
    }
  }
</script>

</html>